/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ps.server.classes;

/**
 *
 * @author Ricardo
 */
public class combinations {

    private String id;
    private String id_product;
    private String reference;
    private String supplier_reference;
    private String location;
    private String ean13;
    private String upc;
    private double wholesale_price;
    private double price;
    private double ecotax;
    private int quantity;
    private String weight;
    private String default_on;
    private String[] product_option_values;
    private String[] images;
    private int column=15;

    public int getColumn() {
        return column;
    }
    
    public String getDefault_on() {
        return default_on;
    }

    public void setDefault_on(String default_on) {
        this.default_on = default_on;
    }

    public String getEan13() {
        return ean13;
    }

    public void setEan13(String ean13) {
        this.ean13 = ean13;
    }

    public double getEcotax() {
        return ecotax;
    }

    public void setEcotax(double ecotax) {
        this.ecotax = ecotax;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getId_product() {
        return id_product;
    }

    public void setId_product(String id_product) {
        this.id_product = id_product;
    }

    public String[] getImages() {
        return images;
    }

    public void setImages(String[] image) {
        this.images = image;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String[] getProduct_option_values() {
        return product_option_values;
    }

    public void setProduct_option_values(String[] product_option_values) {
        this.product_option_values = product_option_values;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    public String getReference() {
        return reference;
    }

    public void setReference(String reference) {
        this.reference = reference;
    }

    public String getSupplier_reference() {
        return supplier_reference;
    }

    public void setSupplier_reference(String supplier_reference) {
        this.supplier_reference = supplier_reference;
    }

    public String getUpc() {
        return upc;
    }

    public void setUpc(String upc) {
        this.upc = upc;
    }

    public String getWeight() {
        return weight;
    }

    public void setWeight(String weight) {
        this.weight = weight;
    }

    public double getWholesale_price() {
        return wholesale_price;
    }

    public void setWholesale_price(double wholesale_price) {
        this.wholesale_price = wholesale_price;
    }

    public String toXML() {
        String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
        xml += "<prestashop xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n";
        xml += "<combination>\n";
        xml += "<id></id>\n";
        xml += "<id_product></id_product>\n";
        xml += "<reference></reference>\n";
        xml += "<supplier_reference></supplier_reference>\n";
        xml += "<location></location>\n";
        xml += "<ean13></ean13>\n";
        xml += "<upc></upc>\n";
        xml += "<wholesale_price></wholesale_price>\n";
        xml += "<price></price>\n";
        xml += "<ecotax></ecotax>\n";
        xml += "<quantity></quantity>\n";
        xml += "<weight></weight>\n";
        xml += "<default_on></default_on>\n";
        xml += "<associations>\n";
        xml += "<product_option_values>\n";
        for (int x = 0; this.product_option_values.length > x; x++) {
            xml += "<product_option_value>\n";
            xml += "<id>" + this.product_option_values[x] + "</id>\n";
            xml += "</product_option_value>\n";
        }
        //xml+="<product_option_value>\n";
        //xml+="<id></id>\n";
        //xml+="</product_option_value>\n";
        xml += "</product_option_values>\n";
        xml += "<images>\n";
        for (int x = 0; this.images.length > x; x++) {
            xml += "<image>\n";
            xml += "<id>" + this.images[x] + "</id>\n";
            xml += "</image>\n";
        }
        //xml+="<image>\n";
        //xml+="<id></id>\n";
        //xml+="</image>\n";
        xml += "</images>\n";
        xml += "</associations>\n";
        xml += "</combination>\n";
        xml += "</prestashop>";
        return xml;
    }

    public String[] GetMetaData() {
        return new String[]{"id", 
            "id_product", 
            "reference", 
            "supplier_reference", 
            "location", 
            "ean13", 
            "upc", 
            "wholesale_price", 
            "price", 
            "ecotax", 
            "quantity", 
            "weight", 
            "default_on", 
            "product_option_values", 
            "images"};
    }
}
